#Set working directory to appropriate folder for inputs and outputs on Google Drive
load('2022_01_14_analysis_scripts/2022_05_27_analysis/Assign_dominant_barcodes/all_data_final_lineages.RData') #seurat object with final lineage assignments
load('2022_01_14_analysis_scripts/2022_05_27_analysis/Preprocess_gDNA/preprocessed_gDNA.RData') # need list of all gDNA reads per lineage
load('2022_01_14_analysis_scripts/2022_05_27_analysis/Filtering_cDNA/filtered_cDNA.RData') # need list of all lineages with cDNA representation
load('2022_01_14_analysis_scripts/2022_05_27_analysis/Filtering_cDNA/resistant_lineage_lists.RData') # list of lineages passing filtering
load('2022_01_14_analysis_scripts/2022_05_27_analysis/Assign_dominant_barcodes/all_data_final_lineages.RData') # Load in the single cell object
#How many reads for each of these lineages? How many cells? Plot distribution of lineage size (cells? reads? which time?), correlation between time 1 and 2
nofilter_gDNA_lins <- list()
for (i in names(gDNA_collapsed)){
if (i != 'FirstSample'){
nofilter_gDNA_lins[[i]] <- gDNA_collapsed[[i]]$Lineage[gDNA_collapsed[[i]]$Reads > 1]
}
}
dabtram_cocl2 <- list(dabtram = unique(c(nofilter_gDNA_lins$DabTram, nofilter_gDNA_lins$DabTramtoCis, nofilter_gDNA_lins$DabTramtoCoCl2, nofilter_gDNA_lins$DabTramtoDabTram)),
cocl2 = unique(c(nofilter_gDNA_lins$CoCl2, nofilter_gDNA_lins$CoCl2toCis, nofilter_gDNA_lins$CoCl2toCoCl2, nofilter_gDNA_lins$CoCl2toDabTram)),
dabtramtococl2 = nofilter_gDNA_lins$DabTramtoCoCl2,
cocl2todabtram = nofilter_gDNA_lins$CoCl2toDabTram)
dabtram_cis <- list(dabtram = unique(c(nofilter_gDNA_lins$DabTram, nofilter_gDNA_lins$DabTramtoCis, nofilter_gDNA_lins$DabTramtoCoCl2, nofilter_gDNA_lins$DabTramtoDabTram)),
cis = unique(c(nofilter_gDNA_lins$Cis, nofilter_gDNA_lins$CistoCis, nofilter_gDNA_lins$CistoCoCl2, nofilter_gDNA_lins$CistoDabTram)),
dabtramtocis = nofilter_gDNA_lins$DabTramtoCis,
cistodabtram = nofilter_gDNA_lins$CistoDabTram)
cocl2_cis <- list(cocl2 = unique(c(nofilter_gDNA_lins$CoCl2, nofilter_gDNA_lins$CoCl2toCis, nofilter_gDNA_lins$CoCl2toCoCl2, nofilter_gDNA_lins$CoCl2toDabTram)),
cis = (c(nofilter_gDNA_lins$Cis, nofilter_gDNA_lins$CistoCis, nofilter_gDNA_lins$CistoCoCl2, nofilter_gDNA_lins$CistoDabTram)),
cocl2tocis = nofilter_gDNA_lins$CoCl2toCis,
cistococl2 = nofilter_gDNA_lins$CistoCoCl2)
induced_resistant_lins <- list()
dabtram_cocl2_venn <- venn(dabtram_cocl2)
dabtram_cis_venn <- venn(dabtram_cis)
cocl2_cis_venn <- venn(cocl2_cis)
induced_resistant_lins[['DabTram_Inducedto_CoCl2']] = attr(dabtram_cocl2_venn, "intersections")$'dabtram:dabtramtococl2'
induced_resistant_lins[['CoCl2_Inducedto_DabTram']] = attr(dabtram_cocl2_venn, "intersections")$'cocl2:cocl2todabtram'
induced_resistant_lins[['DabTram_Inducedto_Cis']] = attr(dabtram_cis_venn, "intersections")$'dabtram:dabtramtocis'
induced_resistant_lins[['Cis_Inducedto_DabTram']] = attr(dabtram_cis_venn, "intersections")$'cis:cistodabtram'
induced_resistant_lins[['CoCl2_Inducedto_Cis']] = attr(cocl2_cis_venn, "intersections")$'cocl2:cocl2tocis'
induced_resistant_lins[['Cis_Inducedto_CoCl2']] = attr(cocl2_cis_venn, "intersections")$'cis:cistococl2'
#plotting cell # correlation between time 1 and 2
induced_resistant_df <- list()
for (i in names(induced_resistant_lins)){
split <- strsplit(i, '_')
time1 <- split[[1]][1]
time2 <- paste0(split[[1]][1], 'to', split[[1]][3])
test <- filter(gDNA_collapsed[[time1]], gDNA_collapsed[[time1]]$Lineage %in% induced_resistant_lins[[i]])
colnames(test)[colnames(test) == "Reads"] <- "Reads_time1"
colnames(test)[colnames(test) == "RPM"] <- "RPM_time1"
test$Num_Cells_time1 <- rep(0, length(test$Lineage))
test$Num_Cells_time2 <- rep(0, length(test$Lineage))
test$Reads_time2 <- rep(0, length(test$Lineage))
for (k in 1:length(test$Lineage)){
lin <- test$Lineage[[k]]
if (is.element(lin, gDNA_cDNA_collapsed[[time1]]$Lineage)){
test$Num_Cells_time1[[k]] <- gDNA_cDNA_collapsed[[time1]]$Num_Cells[gDNA_cDNA_collapsed[[time1]]$Lineage == lin]
}
if (is.element(lin, gDNA_cDNA_collapsed[[time2]]$Lineage)){
test$Num_Cells_time2[[k]] <- gDNA_cDNA_collapsed[[time2]]$Num_Cells[gDNA_cDNA_collapsed[[time2]]$Lineage == lin]
}
test$Reads_time2[[k]] <- gDNA_collapsed[[time2]]$Reads[gDNA_collapsed[[time2]]$Lineage == lin]
test$Num_Cells_time1_norm[[k]] <- test$Num_Cells_time1[[k]] / length(all_data$OG_condition == time1)
}
induced_resistant_df[[i]] <- test
}
for (i in names(induced_resistant_df)){
print(ggplot(induced_resistant_df[[i]], aes(x = Num_Cells_time2, y = Num_Cells_time1)) + geom_point() + ggtitle(paste("per lineage # cells at time 1 vs time 2 in", i)))
}
# for (i in names(cDNA_excluded)){
# print(ggplot(data = cDNA_excluded[[i]], aes(x = Num_Cells)) + geom_bar() + labs(x = 'Number of Cells per lineage', title = paste(i, "cDNA lineages lost in filtering")))
# print(ggplot(data = gDNA_cDNA_collapsed[[i]], aes(x = Num_Cells)) + geom_bar() + labs(x = 'Number of Cells per lineage ', title = paste(i, "cDNA lineages prior to filtering")))
# }
# dev.off()
# Finding the lineages that end up induced resistant to cocl2, in the dabtram object
Dabtram_inducedto_CoCl2 <- names(all_data$Lineage[all_data$OG_condition == 'dabtram' & all_data$Lineage %in% induced_resistant_lins$DabTram_Inducedto_CoCl2])
# Finding the lineages did not
Dabtram_not_inducedto_CoCl2 <- names(all_data$Lineage[all_data$OG_condition == 'dabtram' & all_data$Lineage %in% attr(dabtram_cocl2_venn, "intersections")$'dabtram'])
# Find induced markers
dabtram_inducedto_cocl2_markers <- FindMarkers(all_data, ident.1 = Dabtram_inducedto_CoCl2, ident.2 = Dabtram_not_inducedto_CoCl2, logfc.threshold = 0.25)
| | 0 % ~calculating
|+ | 1 % ~03s
|++ | 2 % ~03s
|++ | 3 % ~02s
|+++ | 4 % ~02s
|+++ | 5 % ~02s
|++++ | 6 % ~02s
|++++ | 7 % ~02s
|+++++ | 8 % ~02s
|+++++ | 9 % ~02s
|++++++ | 10% ~02s
|++++++ | 11% ~02s
|+++++++ | 12% ~02s
|+++++++ | 13% ~02s
|++++++++ | 14% ~02s
|++++++++ | 15% ~02s
|+++++++++ | 16% ~02s
|+++++++++ | 18% ~02s
|++++++++++ | 19% ~02s
|++++++++++ | 20% ~02s
|+++++++++++ | 21% ~02s
|+++++++++++ | 22% ~02s
|++++++++++++ | 23% ~02s
|++++++++++++ | 24% ~02s
|+++++++++++++ | 25% ~02s
|+++++++++++++ | 26% ~02s
|++++++++++++++ | 27% ~02s
|++++++++++++++ | 28% ~02s
|+++++++++++++++ | 29% ~02s
|+++++++++++++++ | 30% ~02s
|++++++++++++++++ | 31% ~02s
|++++++++++++++++ | 32% ~02s
|+++++++++++++++++ | 33% ~02s
|++++++++++++++++++ | 34% ~02s
|++++++++++++++++++ | 35% ~02s
|+++++++++++++++++++ | 36% ~02s
|+++++++++++++++++++ | 37% ~02s
|++++++++++++++++++++ | 38% ~01s
|++++++++++++++++++++ | 39% ~01s
|+++++++++++++++++++++ | 40% ~01s
|+++++++++++++++++++++ | 41% ~01s
|++++++++++++++++++++++ | 42% ~01s
|++++++++++++++++++++++ | 43% ~01s
|+++++++++++++++++++++++ | 44% ~01s
|+++++++++++++++++++++++ | 45% ~01s
|++++++++++++++++++++++++ | 46% ~01s
|++++++++++++++++++++++++ | 47% ~01s
|+++++++++++++++++++++++++ | 48% ~01s
|+++++++++++++++++++++++++ | 49% ~01s
|++++++++++++++++++++++++++ | 51% ~01s
|++++++++++++++++++++++++++ | 52% ~01s
|+++++++++++++++++++++++++++ | 53% ~01s
|+++++++++++++++++++++++++++ | 54% ~01s
|++++++++++++++++++++++++++++ | 55% ~01s
|++++++++++++++++++++++++++++ | 56% ~01s
|+++++++++++++++++++++++++++++ | 57% ~01s
|+++++++++++++++++++++++++++++ | 58% ~01s
|++++++++++++++++++++++++++++++ | 59% ~01s
|++++++++++++++++++++++++++++++ | 60% ~01s
|+++++++++++++++++++++++++++++++ | 61% ~01s
|+++++++++++++++++++++++++++++++ | 62% ~01s
|++++++++++++++++++++++++++++++++ | 63% ~01s
|++++++++++++++++++++++++++++++++ | 64% ~01s
|+++++++++++++++++++++++++++++++++ | 65% ~01s
|+++++++++++++++++++++++++++++++++ | 66% ~01s
|++++++++++++++++++++++++++++++++++ | 67% ~01s
|+++++++++++++++++++++++++++++++++++ | 68% ~01s
|+++++++++++++++++++++++++++++++++++ | 69% ~01s
|++++++++++++++++++++++++++++++++++++ | 70% ~01s
|++++++++++++++++++++++++++++++++++++ | 71% ~01s
|+++++++++++++++++++++++++++++++++++++ | 72% ~01s
|+++++++++++++++++++++++++++++++++++++ | 73% ~01s
|++++++++++++++++++++++++++++++++++++++ | 74% ~01s
|++++++++++++++++++++++++++++++++++++++ | 75% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 76% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 78% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 80% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 82% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=03s
# Also want to plot these lineages on umap along with induced resistance genes
Idents(all_data) <- all_data$OG_condition
dabtram <- subset(all_data, idents = 'dabtram')
dabtram <- FindNeighbors(dabtram, dims = 1:10)
Computing nearest neighbor graph
Computing SNN
dabtram <- FindClusters(dabtram, resolution = 0.5)
Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
Number of nodes: 3203
Number of edges: 108151
Running Louvain algorithm...
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Maximum modularity in 10 random starts: 0.8611
Number of communities: 7
Elapsed time: 0 seconds
dabtram <- RunUMAP(dabtram, dims = 1:10)
15:27:24 UMAP embedding parameters a = 0.9922 b = 1.112
15:27:24 Read 3203 rows and found 10 numeric columns
15:27:24 Using Annoy for neighbor search, n_neighbors = 30
15:27:24 Building Annoy index with metric = cosine, n_trees = 50
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
15:27:24 Writing NN index file to temp file /var/folders/ph/24prrxys02179y9_qzhxjgvc0000gn/T//Rtmp85KPIJ/file1376631b15490
15:27:24 Searching Annoy index using 1 thread, search_k = 3000
15:27:25 Annoy recall = 100%
15:27:26 Commencing smooth kNN distance calibration using 1 thread
15:27:28 Initializing from normalized Laplacian + noise
15:27:28 Commencing optimization for 500 epochs, with 133908 positive edges
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
15:27:33 Optimization finished
DimPlot(dabtram, reduction = 'umap')
FeaturePlot(dabtram, features = c("IGFBP5","COL1A1","CAV1"))
DimPlot(dabtram, cells.highlight = Dabtram_inducedto_CoCl2, cols.highlight = c('red'))
DimPlot(dabtram, cells.highlight = Dabtram_not_inducedto_CoCl2, cols.highlight = c('blue'))
# Finding the lineages that end up induced resistant to cocl2, in the dabtram object
CoCl2_inducedto_Dabtram <- names(all_data$Lineage[all_data$OG_condition == 'cocl2' & all_data$Lineage %in% induced_resistant_lins$CoCl2_Inducedto_DabTram])
# Finding the lineages did not
CoCl2_not_inducedto_Dabtram <- names(all_data$Lineage[all_data$OG_condition == 'cocl2' & all_data$Lineage %in% attr(dabtram_cocl2_venn, "intersections")$'cocl2'])
# Find induced markers
cocl2_inducedto_dabtram_markers <- FindMarkers(all_data, ident.1 = CoCl2_inducedto_Dabtram, ident.2 = CoCl2_not_inducedto_Dabtram, logfc.threshold = 0.25)
| | 0 % ~calculating
|+ | 1 % ~01s
|++ | 3 % ~00s
|+++ | 4 % ~00s
|+++ | 5 % ~00s
|++++ | 7 % ~00s
|+++++ | 8 % ~00s
|+++++ | 9 % ~00s
|++++++ | 11% ~00s
|+++++++ | 12% ~00s
|+++++++ | 14% ~00s
|++++++++ | 15% ~00s
|+++++++++ | 16% ~00s
|+++++++++ | 18% ~00s
|++++++++++ | 19% ~00s
|+++++++++++ | 20% ~00s
|+++++++++++ | 22% ~00s
|++++++++++++ | 23% ~00s
|+++++++++++++ | 24% ~00s
|+++++++++++++ | 26% ~00s
|++++++++++++++ | 27% ~00s
|+++++++++++++++ | 28% ~00s
|+++++++++++++++ | 30% ~00s
|++++++++++++++++ | 31% ~00s
|+++++++++++++++++ | 32% ~00s
|+++++++++++++++++ | 34% ~00s
|++++++++++++++++++ | 35% ~00s
|+++++++++++++++++++ | 36% ~00s
|+++++++++++++++++++ | 38% ~00s
|++++++++++++++++++++ | 39% ~00s
|+++++++++++++++++++++ | 41% ~00s
|+++++++++++++++++++++ | 42% ~00s
|++++++++++++++++++++++ | 43% ~00s
|+++++++++++++++++++++++ | 45% ~00s
|+++++++++++++++++++++++ | 46% ~00s
|++++++++++++++++++++++++ | 47% ~00s
|+++++++++++++++++++++++++ | 49% ~00s
|+++++++++++++++++++++++++ | 50% ~00s
|++++++++++++++++++++++++++ | 51% ~00s
|+++++++++++++++++++++++++++ | 53% ~00s
|++++++++++++++++++++++++++++ | 54% ~00s
|++++++++++++++++++++++++++++ | 55% ~00s
|+++++++++++++++++++++++++++++ | 57% ~00s
|++++++++++++++++++++++++++++++ | 58% ~00s
|++++++++++++++++++++++++++++++ | 59% ~00s
|+++++++++++++++++++++++++++++++ | 61% ~00s
|++++++++++++++++++++++++++++++++ | 62% ~00s
|++++++++++++++++++++++++++++++++ | 64% ~00s
|+++++++++++++++++++++++++++++++++ | 65% ~00s
|++++++++++++++++++++++++++++++++++ | 66% ~00s
|++++++++++++++++++++++++++++++++++ | 68% ~00s
|+++++++++++++++++++++++++++++++++++ | 69% ~00s
|++++++++++++++++++++++++++++++++++++ | 70% ~00s
|++++++++++++++++++++++++++++++++++++ | 72% ~00s
|+++++++++++++++++++++++++++++++++++++ | 73% ~00s
|++++++++++++++++++++++++++++++++++++++ | 74% ~00s
|++++++++++++++++++++++++++++++++++++++ | 76% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 78% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 82% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 86% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s
# Also want to plot these lineages on umap along with induced resistance genes
Idents(all_data) <- all_data$OG_condition
cocl2 <- subset(all_data, idents = 'cocl2')
cocl2 <- FindNeighbors(cocl2, dims = 1:10)
Computing nearest neighbor graph
Computing SNN
cocl2 <- FindClusters(cocl2, resolution = 0.5)
Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
Number of nodes: 4823
Number of edges: 160093
Running Louvain algorithm...
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Maximum modularity in 10 random starts: 0.8374
Number of communities: 9
Elapsed time: 0 seconds
cocl2 <- RunUMAP(cocl2, dims = 1:10)
15:27:38 UMAP embedding parameters a = 0.9922 b = 1.112
15:27:38 Read 4823 rows and found 10 numeric columns
15:27:38 Using Annoy for neighbor search, n_neighbors = 30
15:27:38 Building Annoy index with metric = cosine, n_trees = 50
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
15:27:39 Writing NN index file to temp file /var/folders/ph/24prrxys02179y9_qzhxjgvc0000gn/T//Rtmp85KPIJ/file137667126d36c
15:27:39 Searching Annoy index using 1 thread, search_k = 3000
15:27:40 Annoy recall = 100%
15:27:41 Commencing smooth kNN distance calibration using 1 thread
15:27:43 Initializing from normalized Laplacian + noise
15:27:43 Commencing optimization for 500 epochs, with 195924 positive edges
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
15:27:50 Optimization finished
DimPlot(cocl2, reduction = 'umap')
FeaturePlot(cocl2, features = c("RAMP1","CYTL1","MT-CO3"))
DimPlot(cocl2, cells.highlight = CoCl2_inducedto_Dabtram, cols.highlight = c('red'))
DimPlot(cocl2, cells.highlight = CoCl2_not_inducedto_Dabtram, cols.highlight = c('blue'))
# Finding the lineages that end up induced resistant to cocl2, in the dabtram object
Dabtram_inducedto_Cis <- names(all_data$Lineage[all_data$OG_condition == 'dabtram' & all_data$Lineage %in% induced_resistant_lins$DabTram_Inducedto_Cis])
# Finding the lineages did not
Dabtram_not_inducedto_Cis <- names(all_data$Lineage[all_data$OG_condition == 'dabtram' & all_data$Lineage %in% attr(dabtram_cis_venn, "intersections")$'dabtram'])
# Find induced markers
dabtram_inducedto_cis_markers <- FindMarkers(all_data, ident.1 = Dabtram_inducedto_Cis, ident.2 = Dabtram_not_inducedto_Cis, logfc.threshold = 0.25)
| | 0 % ~calculating
|+ | 1 % ~01s
|++ | 2 % ~00s
|++ | 3 % ~00s
|+++ | 5 % ~00s
|+++ | 6 % ~00s
|++++ | 7 % ~00s
|+++++ | 8 % ~00s
|+++++ | 9 % ~00s
|++++++ | 10% ~00s
|++++++ | 11% ~00s
|+++++++ | 13% ~00s
|+++++++ | 14% ~00s
|++++++++ | 15% ~00s
|+++++++++ | 16% ~00s
|+++++++++ | 17% ~00s
|++++++++++ | 18% ~00s
|++++++++++ | 20% ~00s
|+++++++++++ | 21% ~00s
|+++++++++++ | 22% ~00s
|++++++++++++ | 23% ~00s
|+++++++++++++ | 24% ~00s
|+++++++++++++ | 25% ~00s
|++++++++++++++ | 26% ~00s
|++++++++++++++ | 28% ~00s
|+++++++++++++++ | 29% ~00s
|+++++++++++++++ | 30% ~00s
|++++++++++++++++ | 31% ~00s
|+++++++++++++++++ | 32% ~00s
|+++++++++++++++++ | 33% ~00s
|++++++++++++++++++ | 34% ~00s
|++++++++++++++++++ | 36% ~00s
|+++++++++++++++++++ | 37% ~00s
|+++++++++++++++++++ | 38% ~00s
|++++++++++++++++++++ | 39% ~00s
|+++++++++++++++++++++ | 40% ~00s
|+++++++++++++++++++++ | 41% ~00s
|++++++++++++++++++++++ | 43% ~00s
|++++++++++++++++++++++ | 44% ~00s
|+++++++++++++++++++++++ | 45% ~00s
|+++++++++++++++++++++++ | 46% ~00s
|++++++++++++++++++++++++ | 47% ~00s
|+++++++++++++++++++++++++ | 48% ~00s
|+++++++++++++++++++++++++ | 49% ~00s
|++++++++++++++++++++++++++ | 51% ~00s
|++++++++++++++++++++++++++ | 52% ~00s
|+++++++++++++++++++++++++++ | 53% ~00s
|++++++++++++++++++++++++++++ | 54% ~00s
|++++++++++++++++++++++++++++ | 55% ~00s
|+++++++++++++++++++++++++++++ | 56% ~00s
|+++++++++++++++++++++++++++++ | 57% ~00s
|++++++++++++++++++++++++++++++ | 59% ~00s
|++++++++++++++++++++++++++++++ | 60% ~00s
|+++++++++++++++++++++++++++++++ | 61% ~00s
|++++++++++++++++++++++++++++++++ | 62% ~00s
|++++++++++++++++++++++++++++++++ | 63% ~00s
|+++++++++++++++++++++++++++++++++ | 64% ~00s
|+++++++++++++++++++++++++++++++++ | 66% ~00s
|++++++++++++++++++++++++++++++++++ | 67% ~00s
|++++++++++++++++++++++++++++++++++ | 68% ~00s
|+++++++++++++++++++++++++++++++++++ | 69% ~00s
|++++++++++++++++++++++++++++++++++++ | 70% ~00s
|++++++++++++++++++++++++++++++++++++ | 71% ~00s
|+++++++++++++++++++++++++++++++++++++ | 72% ~00s
|+++++++++++++++++++++++++++++++++++++ | 74% ~00s
|++++++++++++++++++++++++++++++++++++++ | 75% ~00s
|++++++++++++++++++++++++++++++++++++++ | 76% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 78% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 80% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 86% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s
# Also want to plot these lineages on umap along with induced resistance genes
Idents(all_data) <- all_data$OG_condition
dabtram <- subset(all_data, idents = 'dabtram')
dabtram <- FindNeighbors(dabtram, dims = 1:10)
Computing nearest neighbor graph
Computing SNN
dabtram <- FindClusters(dabtram, resolution = 0.5)
Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
Number of nodes: 3203
Number of edges: 108151
Running Louvain algorithm...
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Maximum modularity in 10 random starts: 0.8611
Number of communities: 7
Elapsed time: 0 seconds
dabtram <- RunUMAP(dabtram, dims = 1:10)
15:27:55 UMAP embedding parameters a = 0.9922 b = 1.112
15:27:55 Read 3203 rows and found 10 numeric columns
15:27:55 Using Annoy for neighbor search, n_neighbors = 30
15:27:55 Building Annoy index with metric = cosine, n_trees = 50
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
15:27:55 Writing NN index file to temp file /var/folders/ph/24prrxys02179y9_qzhxjgvc0000gn/T//Rtmp85KPIJ/file137662c02917d
15:27:55 Searching Annoy index using 1 thread, search_k = 3000
15:27:56 Annoy recall = 100%
15:27:57 Commencing smooth kNN distance calibration using 1 thread
15:27:59 Initializing from normalized Laplacian + noise
15:27:59 Commencing optimization for 500 epochs, with 133908 positive edges
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
15:28:04 Optimization finished
DimPlot(dabtram, reduction = 'umap')
FeaturePlot(dabtram, features = c("PMEL","A2M","CTSK"))
DimPlot(dabtram, cells.highlight = Dabtram_inducedto_Cis, cols.highlight = c('red'))
DimPlot(dabtram, cells.highlight = Dabtram_not_inducedto_Cis, cols.highlight = c('blue'))
# Finding the lineages that end up induced resistant to cocl2, in the cis object
CoCl2_inducedto_Cis <- names(all_data$Lineage[all_data$OG_condition == 'cocl2' & all_data$Lineage %in% induced_resistant_lins$CoCl2_Inducedto_Cis])
# Finding the lineages did not
CoCl2_not_inducedto_Cis <- names(all_data$Lineage[all_data$OG_condition == 'cocl2' & all_data$Lineage %in% attr(cocl2_cis_venn, "intersections")$'cocl2'])
# Find induced markers
cocl2_inducedto_cis_markers <- FindMarkers(all_data, ident.1 = CoCl2_inducedto_Cis, ident.2 = CoCl2_not_inducedto_Cis, logfc.threshold = 0.25)
| | 0 % ~calculating
|+ | 1 % ~01s
|++ | 2 % ~01s
|++ | 3 % ~00s
|+++ | 4 % ~00s
|+++ | 5 % ~00s
|++++ | 7 % ~00s
|++++ | 8 % ~00s
|+++++ | 9 % ~00s
|+++++ | 10% ~00s
|++++++ | 11% ~00s
|+++++++ | 12% ~00s
|+++++++ | 13% ~00s
|++++++++ | 14% ~00s
|++++++++ | 15% ~00s
|+++++++++ | 16% ~00s
|+++++++++ | 18% ~00s
|++++++++++ | 19% ~00s
|++++++++++ | 20% ~00s
|+++++++++++ | 21% ~00s
|+++++++++++ | 22% ~00s
|++++++++++++ | 23% ~00s
|+++++++++++++ | 24% ~00s
|+++++++++++++ | 25% ~00s
|++++++++++++++ | 26% ~00s
|++++++++++++++ | 27% ~00s
|+++++++++++++++ | 29% ~00s
|+++++++++++++++ | 30% ~00s
|++++++++++++++++ | 31% ~00s
|++++++++++++++++ | 32% ~00s
|+++++++++++++++++ | 33% ~00s
|++++++++++++++++++ | 34% ~00s
|++++++++++++++++++ | 35% ~00s
|+++++++++++++++++++ | 36% ~00s
|+++++++++++++++++++ | 37% ~00s
|++++++++++++++++++++ | 38% ~00s
|++++++++++++++++++++ | 40% ~00s
|+++++++++++++++++++++ | 41% ~00s
|+++++++++++++++++++++ | 42% ~00s
|++++++++++++++++++++++ | 43% ~00s
|++++++++++++++++++++++ | 44% ~00s
|+++++++++++++++++++++++ | 45% ~00s
|++++++++++++++++++++++++ | 46% ~00s
|++++++++++++++++++++++++ | 47% ~00s
|+++++++++++++++++++++++++ | 48% ~00s
|+++++++++++++++++++++++++ | 49% ~00s
|++++++++++++++++++++++++++ | 51% ~00s
|++++++++++++++++++++++++++ | 52% ~00s
|+++++++++++++++++++++++++++ | 53% ~00s
|+++++++++++++++++++++++++++ | 54% ~00s
|++++++++++++++++++++++++++++ | 55% ~00s
|+++++++++++++++++++++++++++++ | 56% ~00s
|+++++++++++++++++++++++++++++ | 57% ~00s
|++++++++++++++++++++++++++++++ | 58% ~00s
|++++++++++++++++++++++++++++++ | 59% ~00s
|+++++++++++++++++++++++++++++++ | 60% ~00s
|+++++++++++++++++++++++++++++++ | 62% ~00s
|++++++++++++++++++++++++++++++++ | 63% ~00s
|++++++++++++++++++++++++++++++++ | 64% ~00s
|+++++++++++++++++++++++++++++++++ | 65% ~00s
|+++++++++++++++++++++++++++++++++ | 66% ~00s
|++++++++++++++++++++++++++++++++++ | 67% ~00s
|+++++++++++++++++++++++++++++++++++ | 68% ~00s
|+++++++++++++++++++++++++++++++++++ | 69% ~00s
|++++++++++++++++++++++++++++++++++++ | 70% ~00s
|++++++++++++++++++++++++++++++++++++ | 71% ~00s
|+++++++++++++++++++++++++++++++++++++ | 73% ~00s
|+++++++++++++++++++++++++++++++++++++ | 74% ~00s
|++++++++++++++++++++++++++++++++++++++ | 75% ~00s
|++++++++++++++++++++++++++++++++++++++ | 76% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 78% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 80% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 82% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s
# Also want to plot these lineages on umap along with induced resistance genes
Idents(all_data) <- all_data$OG_condition
cocl2 <- subset(all_data, idents = 'cocl2')
cocl2 <- FindNeighbors(cocl2, dims = 1:10)
Computing nearest neighbor graph
Computing SNN
cocl2 <- FindClusters(cocl2, resolution = 0.5)
Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
Number of nodes: 4823
Number of edges: 160093
Running Louvain algorithm...
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Maximum modularity in 10 random starts: 0.8374
Number of communities: 9
Elapsed time: 0 seconds
cocl2 <- RunUMAP(cocl2, dims = 1:10)
15:28:10 UMAP embedding parameters a = 0.9922 b = 1.112
15:28:10 Read 4823 rows and found 10 numeric columns
15:28:10 Using Annoy for neighbor search, n_neighbors = 30
15:28:10 Building Annoy index with metric = cosine, n_trees = 50
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
15:28:10 Writing NN index file to temp file /var/folders/ph/24prrxys02179y9_qzhxjgvc0000gn/T//Rtmp85KPIJ/file137665c9dbc1d
15:28:10 Searching Annoy index using 1 thread, search_k = 3000
15:28:11 Annoy recall = 100%
15:28:12 Commencing smooth kNN distance calibration using 1 thread
15:28:14 Initializing from normalized Laplacian + noise
15:28:14 Commencing optimization for 500 epochs, with 195924 positive edges
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
15:28:21 Optimization finished
DimPlot(cocl2, reduction = 'umap')
FeaturePlot(cocl2, features = c("PMEL","A2M","CTSK"))
DimPlot(cocl2, cells.highlight = CoCl2_inducedto_Cis, cols.highlight = c('red'))
DimPlot(cocl2, cells.highlight = CoCl2_not_inducedto_Cis, cols.highlight = c('blue'))
# Finding the lineages that end up induced resistant to cocl2, in the dabtram object
Cis_inducedto_Dabtram <- names(all_data$Lineage[all_data$OG_condition == 'cis' & all_data$Lineage %in% induced_resistant_lins$Cis_Inducedto_DabTram])
# Finding the lineages did not
Cis_not_inducedto_Dabtram <- names(all_data$Lineage[all_data$OG_condition == 'cis' & all_data$Lineage %in% attr(dabtram_cis_venn, "intersections")$'cis'])
# Find induced markers
cis_inducedto_dabtram_markers <- FindMarkers(all_data, ident.1 = Cis_inducedto_Dabtram, ident.2 = Cis_not_inducedto_Dabtram, logfc.threshold = 0.25)
| | 0 % ~calculating
|+ | 1 % ~01s
|++ | 2 % ~01s
|++ | 3 % ~01s
|+++ | 4 % ~01s
|+++ | 5 % ~01s
|++++ | 6 % ~01s
|++++ | 7 % ~01s
|+++++ | 9 % ~01s
|+++++ | 10% ~01s
|++++++ | 11% ~01s
|++++++ | 12% ~01s
|+++++++ | 13% ~01s
|+++++++ | 14% ~01s
|++++++++ | 15% ~01s
|++++++++ | 16% ~01s
|+++++++++ | 17% ~01s
|++++++++++ | 18% ~01s
|++++++++++ | 19% ~01s
|+++++++++++ | 20% ~01s
|+++++++++++ | 21% ~01s
|++++++++++++ | 22% ~01s
|++++++++++++ | 23% ~01s
|+++++++++++++ | 24% ~01s
|+++++++++++++ | 26% ~01s
|++++++++++++++ | 27% ~01s
|++++++++++++++ | 28% ~01s
|+++++++++++++++ | 29% ~01s
|+++++++++++++++ | 30% ~01s
|++++++++++++++++ | 31% ~01s
|++++++++++++++++ | 32% ~01s
|+++++++++++++++++ | 33% ~01s
|++++++++++++++++++ | 34% ~00s
|++++++++++++++++++ | 35% ~00s
|+++++++++++++++++++ | 36% ~00s
|+++++++++++++++++++ | 37% ~00s
|++++++++++++++++++++ | 38% ~00s
|++++++++++++++++++++ | 39% ~00s
|+++++++++++++++++++++ | 40% ~00s
|+++++++++++++++++++++ | 41% ~00s
|++++++++++++++++++++++ | 43% ~00s
|++++++++++++++++++++++ | 44% ~00s
|+++++++++++++++++++++++ | 45% ~00s
|+++++++++++++++++++++++ | 46% ~00s
|++++++++++++++++++++++++ | 47% ~00s
|++++++++++++++++++++++++ | 48% ~00s
|+++++++++++++++++++++++++ | 49% ~00s
|+++++++++++++++++++++++++ | 50% ~00s
|++++++++++++++++++++++++++ | 51% ~00s
|+++++++++++++++++++++++++++ | 52% ~00s
|+++++++++++++++++++++++++++ | 53% ~00s
|++++++++++++++++++++++++++++ | 54% ~00s
|++++++++++++++++++++++++++++ | 55% ~00s
|+++++++++++++++++++++++++++++ | 56% ~00s
|+++++++++++++++++++++++++++++ | 57% ~00s
|++++++++++++++++++++++++++++++ | 59% ~00s
|++++++++++++++++++++++++++++++ | 60% ~00s
|+++++++++++++++++++++++++++++++ | 61% ~00s
|+++++++++++++++++++++++++++++++ | 62% ~00s
|++++++++++++++++++++++++++++++++ | 63% ~00s
|++++++++++++++++++++++++++++++++ | 64% ~00s
|+++++++++++++++++++++++++++++++++ | 65% ~00s
|+++++++++++++++++++++++++++++++++ | 66% ~00s
|++++++++++++++++++++++++++++++++++ | 67% ~00s
|+++++++++++++++++++++++++++++++++++ | 68% ~00s
|+++++++++++++++++++++++++++++++++++ | 69% ~00s
|++++++++++++++++++++++++++++++++++++ | 70% ~00s
|++++++++++++++++++++++++++++++++++++ | 71% ~00s
|+++++++++++++++++++++++++++++++++++++ | 72% ~00s
|+++++++++++++++++++++++++++++++++++++ | 73% ~00s
|++++++++++++++++++++++++++++++++++++++ | 74% ~00s
|++++++++++++++++++++++++++++++++++++++ | 76% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 84% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 86% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s
# Also want to plot these lineages on umap along with induced resistance genes
Idents(all_data) <- all_data$OG_condition
cis <- subset(all_data, idents = 'cis')
cis <- FindNeighbors(cis, dims = 1:10)
Computing nearest neighbor graph
Computing SNN
cis <- FindClusters(cis, resolution = 0.5)
Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
Number of nodes: 8303
Number of edges: 244918
Running Louvain algorithm...
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Maximum modularity in 10 random starts: 0.8046
Number of communities: 8
Elapsed time: 1 seconds
cis <- RunUMAP(cis, dims = 1:10)
15:28:29 UMAP embedding parameters a = 0.9922 b = 1.112
15:28:29 Read 8303 rows and found 10 numeric columns
15:28:29 Using Annoy for neighbor search, n_neighbors = 30
15:28:29 Building Annoy index with metric = cosine, n_trees = 50
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
15:28:30 Writing NN index file to temp file /var/folders/ph/24prrxys02179y9_qzhxjgvc0000gn/T//Rtmp85KPIJ/file1376677a9436b
15:28:30 Searching Annoy index using 1 thread, search_k = 3000
15:28:33 Annoy recall = 100%
15:28:33 Commencing smooth kNN distance calibration using 1 thread
15:28:35 Initializing from normalized Laplacian + noise
15:28:35 Commencing optimization for 500 epochs, with 350988 positive edges
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
15:28:47 Optimization finished
DimPlot(cis, reduction = 'umap')
FeaturePlot(cis, features = c("HIST1H1D","CYP51A1","LDHA","HIST1H1B"))
DimPlot(cis, cells.highlight = Cis_inducedto_Dabtram, cols.highlight = c('red'))
DimPlot(cis, cells.highlight = Cis_not_inducedto_Dabtram, cols.highlight = c('blue'))